package com.ch.dream.asynctask;

import org.json.JSONObject;

import android.content.Context;

import com.ch.dream.base.BaseRequestAsyncTask;
import com.ch.dream.bean.DreamstoryBean;
import com.ch.dream.common.CommonRequestUrl;
import com.ch.dream.common.CommonUserInfo;
import com.ch.dream.net.MyHttpAPI;

public class SelectDreamRequestAsyncTask extends BaseRequestAsyncTask {

	private MyHttpAPI myHttpAPI = new MyHttpAPI(CommonRequestUrl.SELECTDREAM);
	
	public SelectDreamRequestAsyncTask(Context context, RequestServerListener requestServerListener) {
		super(context, requestServerListener);
	}
	@Override
	protected Object doInBackground(Object... arg0) {
		JSONObject result;
		try{
			DreamstoryBean bean =(DreamstoryBean)arg0[0];
			JSONObject params = bean.getJsonObject();
			params.put("userId", CommonUserInfo.userId);
			result = myHttpAPI.requestForJson(bean.getJsonObject());
		}catch (Exception e) {
			e.printStackTrace();
			return null;
		}
		return result;
	}

}
